/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package util.exception;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 *
 * @author Rdelacruz
 */
public class ExceptionUtil {
     
    public static String getStackTrace(Exception e) {
        //StackTraceElement[] lista = e.getStackTrace();
        StringWriter writer = new StringWriter();
        PrintWriter printWriter = new PrintWriter( writer );
        e.printStackTrace( printWriter );
        printWriter.flush();
        return writer.toString();               
    }
}
